<?php

	class Shop_adminModel extends Model{

		//指定用户表名
		public $table = 'shop_admin';

		public function validate_login($adminname,$adminpwd){
			$userInfo = $this->where("adminname='{$adminname}'")->find();

			if (!$userInfo) {
				$this->error = '用户名不存在';
				return false;
			}

			//密码判断
			if ($userInfo['adminpwd']!= md5($adminpwd)) {

				$this->error = '密码不正确';
				return false;
			}
			return $userInfo;
		}
	}










?>